using System;
using System.Net.WebSockets;
using System.Threading.Tasks;

namespace GameKitUnity.Network
{
    public interface ISocket
    {
        string Name { get; set; }
        string Address { get; set; }
        WebSocketState State { get; }
        Task Send(byte[] message);

        Task Connect();
        void Close();
        Action OnOpen { get; set; }
        Action OnClose { get; set; }
        Action<byte[]> OnBinary { get; set; }
        Action<Exception> OnError { get; set; }
    }
}